home *** CD-ROM | disk | FTP | other *** search
- package
- {
- import com.plus9.mockups.InputManager;
- import com.plus9.mockups.dialogs.BaseDialog;
- import flash.accessibility.*;
- import flash.data.*;
- import flash.debugger.*;
- import flash.desktop.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filesystem.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.html.*;
- import flash.html.script.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import mx.binding.*;
- import mx.containers.ControlBar;
- import mx.containers.HBox;
- import mx.controls.Button;
- import mx.controls.Label;
- import mx.controls.List;
- import mx.core.ClassFactory;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.PropertyChangeEvent;
- import mx.styles.*;
-
- use namespace mx_internal;
-
- public class SaveMultipleDialog extends BaseDialog implements IBindingClient
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var _91216686_quit:Button;
-
- mx_internal var _bindingsByDestination:Object;
-
- mx_internal var _bindingsBeginWithWord:Object;
-
- private var _339742651dataProvider:Array;
-
- mx_internal var _watchers:Array;
-
- private var _17584667_deselectAll:Button;
-
- private var _1340746649_cancel:Button;
-
- private var _1090049414_selectAll:Button;
-
- private var _91257436_save:Button;
-
- mx_internal var _bindings:Array;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- private var _91056509_list:List;
-
- public function SaveMultipleDialog()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":BaseDialog,
- "propertiesFactory":function():Object
- {
- return {
- "width":402,
- "height":364,
- "childDescriptors":[new UIComponentDescriptor({
- "type":Label,
- "propertiesFactory":function():Object
- {
- return {
- "x":10,
- "y":10,
- "text":"Please select the mockups to save"
- };
- }
- }),new UIComponentDescriptor({
- "type":List,
- "id":"_list",
- "stylesFactory":function():void
- {
- this.left = "10";
- this.right = "10";
- this.top = "35";
- this.bottom = "37";
- this.backgroundAlpha = 0;
- this.color = 0;
- this.textRollOverColor = 0;
- this.textSelectedColor = 0;
- this.rollOverColor = 13421772;
- },
- "propertiesFactory":function():Object
- {
- return {"selectable":false};
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"_selectAll",
- "events":{"click":"___selectAll_click"},
- "stylesFactory":function():void
- {
- this.bottom = "10";
- },
- "propertiesFactory":function():Object
- {
- return {
- "x":10,
- "label":"Select All"
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"_deselectAll",
- "events":{"click":"___deselectAll_click"},
- "stylesFactory":function():void
- {
- this.bottom = "10";
- },
- "propertiesFactory":function():Object
- {
- return {
- "x":84,
- "label":"Deselect All"
- };
- }
- }),new UIComponentDescriptor({
- "type":ControlBar,
- "stylesFactory":function():void
- {
- this.horizontalAlign = "right";
- },
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":HBox,
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":Button,
- "id":"_cancel",
- "events":{"click":"___cancel_click"},
- "propertiesFactory":function():Object
- {
- return {"label":"Don\'t Quit"};
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"_save",
- "events":{"click":"___save_click"},
- "propertiesFactory":function():Object
- {
- return {"label":"Save and Quit"};
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"_quit",
- "events":{"click":"___quit_click"},
- "propertiesFactory":function():Object
- {
- return {"label":"Quit without Saving"};
- }
- })]};
- }
- })]};
- }
- })]
- };
- }
- });
- mx_internal::_bindings = [];
- mx_internal::_watchers = [];
- mx_internal::_bindingsByDestination = {};
- mx_internal::_bindingsBeginWithWord = {};
- super();
- mx_internal::_document = this;
- this.width = 402;
- this.height = 364;
- this.title = "Save Mockups";
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- SaveMultipleDialog._watcherSetupUtil = param1;
- }
-
- public function ___cancel_click(param1:MouseEvent) : void
- {
- onCancel();
- }
-
- public function ___save_click(param1:MouseEvent) : void
- {
- onClick(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get _selectAll() : Button
- {
- return this._1090049414_selectAll;
- }
-
- public function set dataProvider(param1:Array) : void
- {
- var _loc2_:Object = this._339742651dataProvider;
- if(_loc2_ !== param1)
- {
- this._339742651dataProvider = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"dataProvider",_loc2_,param1));
- }
- }
-
- public function set _list(param1:List) : void
- {
- var _loc2_:Object = this._91056509_list;
- if(_loc2_ !== param1)
- {
- this._91056509_list = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_list",_loc2_,param1));
- }
- }
-
- public function ___deselectAll_click(param1:MouseEvent) : void
- {
- onClick(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get dataProvider() : Array
- {
- return this._339742651dataProvider;
- }
-
- override public function init(param1:InputManager) : void
- {
- super.init(param1);
- _list.itemRenderer = new ClassFactory(CheckBoxItemRenderer);
- _list.rendererIsEditor = true;
- defaultButton = _save;
- _save.setFocus();
- }
-
- public function set _deselectAll(param1:Button) : void
- {
- var _loc2_:Object = this._17584667_deselectAll;
- if(_loc2_ !== param1)
- {
- this._17584667_deselectAll = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_deselectAll",_loc2_,param1));
- }
- }
-
- public function set _selectAll(param1:Button) : void
- {
- var _loc2_:Object = this._1090049414_selectAll;
- if(_loc2_ !== param1)
- {
- this._1090049414_selectAll = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_selectAll",_loc2_,param1));
- }
- }
-
- public function set _quit(param1:Button) : void
- {
- var _loc2_:Object = this._91216686_quit;
- if(_loc2_ !== param1)
- {
- this._91216686_quit = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_quit",_loc2_,param1));
- }
- }
-
- public function ___quit_click(param1:MouseEvent) : void
- {
- onClick(param1);
- }
-
- override public function initialize() : void
- {
- var bindings:Array;
- var watchers:Array;
- var i:uint;
- var target:SaveMultipleDialog = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- bindings = _SaveMultipleDialog_bindingsSetup();
- watchers = [];
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_SaveMultipleDialogWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },bindings,watchers);
- i = 0;
- while(i < bindings.length)
- {
- Binding(bindings[i]).execute();
- i++;
- }
- mx_internal::_bindings = mx_internal::_bindings.concat(bindings);
- mx_internal::_watchers = mx_internal::_watchers.concat(watchers);
- super.initialize();
- }
-
- [Bindable(event="propertyChange")]
- public function get _save() : Button
- {
- return this._91257436_save;
- }
-
- [Bindable(event="propertyChange")]
- public function get _deselectAll() : Button
- {
- return this._17584667_deselectAll;
- }
-
- protected function onClick(param1:MouseEvent) : void
- {
- var _loc2_:Object = null;
- switch(param1.target)
- {
- case _selectAll:
- for each(_loc2_ in dataProvider)
- {
- _loc2_.selected = true;
- }
- _list.dataProvider = dataProvider;
- break;
- case _deselectAll:
- for each(_loc2_ in dataProvider)
- {
- _loc2_.selected = false;
- }
- _list.dataProvider = dataProvider;
- break;
- case _save:
- dispatchEvent(new Event("ok"));
- super.onCancel();
- break;
- case _quit:
- for each(_loc2_ in dataProvider)
- {
- _loc2_.selected = false;
- }
- _list.dataProvider = dataProvider;
- dispatchEvent(new Event("ok"));
- super.onCancel();
- }
- }
-
- private function _SaveMultipleDialog_bindingsSetup() : Array
- {
- var binding:Binding = null;
- var result:Array = [];
- binding = new Binding(this,function():Object
- {
- return dataProvider;
- },function(param1:Object):void
- {
- _list.dataProvider = param1;
- },"_list.dataProvider");
- result[0] = binding;
- return result;
- }
-
- [Bindable(event="propertyChange")]
- public function get _quit() : Button
- {
- return this._91216686_quit;
- }
-
- public function ___selectAll_click(param1:MouseEvent) : void
- {
- onClick(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get _cancel() : Button
- {
- return this._1340746649_cancel;
- }
-
- public function set _cancel(param1:Button) : void
- {
- var _loc2_:Object = this._1340746649_cancel;
- if(_loc2_ !== param1)
- {
- this._1340746649_cancel = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_cancel",_loc2_,param1));
- }
- }
-
- private function _SaveMultipleDialog_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = dataProvider;
- }
-
- [Bindable(event="propertyChange")]
- public function get _list() : List
- {
- return this._91056509_list;
- }
-
- public function set _save(param1:Button) : void
- {
- var _loc2_:Object = this._91257436_save;
- if(_loc2_ !== param1)
- {
- this._91257436_save = param1;
- this.dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_save",_loc2_,param1));
- }
- }
- }
- }
-
-